import 'package:fluent_ui/fluent_ui.dart';

class Keyslide extends StatefulWidget {
  final double keyCount;
  final Function(double) setkeyCount;
  final double keyMaxCount;

  const Keyslide(
      {super.key,
      required this.keyCount,
      required this.setkeyCount,
      required this.keyMaxCount});
  @override
  State<StatefulWidget> createState() => _Keyslide();
}

class _Keyslide extends State<Keyslide> {
  @override
  Widget build(BuildContext context) {
    return Container(
        margin: const EdgeInsets.only(top: 20),
        child: SliderTheme(
            data: const SliderThemeData(
              labelBackgroundColor: Colors.black,
            ),
            child: InfoLabel(
              label: "关键词有效数",
              labelStyle: const TextStyle(fontSize: 24, color: Colors.white),
              child: Slider(
                min: 0,
                max: widget.keyMaxCount,
                label: '${widget.keyCount.toInt()}',
                value: widget.keyCount,
                onChanged: (v) => widget.setkeyCount(v),
              ),
            )));
  }
}
